﻿using System;
using System.Collections.Generic;
using System.Text;
using Cashier_Utils;

namespace Cashier_Model
{
    public class TableAttribute: System.Attribute
    {
        private String tablename;
        private String columnname;
        private String columntype;
        private bool iskey;
        private bool iscondition;
        private ConditionType conditiontype;
        private Object compareto;
        private String fieldothername;
        private bool isinsertfield = true;
        private bool isupdatefield;
        private bool isdeletefield;

        /// <summary>
        /// 数据库表名
        /// </summary>
        public virtual String Tablename
        {
            get { return tablename; }
            set { tablename = value; }
        }

        /// <summary>
        /// 数据列别名
        /// </summary>
        public virtual String Fieldothername
        {
            get { return fieldothername; }
            set { fieldothername = value; }
        }

        /// <summary>
        /// 数据列名
        /// </summary>
        public virtual String Columnname
        {
            get { return columnname; }
            set { columnname = value; }
        }

        /// <summary>
        /// 数据列数据类型
        /// </summary>
        public virtual String Columntype
        {
            get { return columntype; }
            set { columntype = value; }
        }

        /// <summary>
        /// 用于查询条件字段的参考值
        /// </summary>
        public virtual Object Compareto
        {
            get { return compareto; }
            set { compareto = value; }
        }

        /// <summary>
        /// 是否表主键
        /// </summary>
        public virtual bool Iskey
        {
            get { return iskey; }
            set { iskey = value; }
        }

        /// <summary>
        /// 是否查询条件列
        /// </summary>
        public virtual bool Iscondition
        {
            get { return iscondition; }
            set { iscondition = value; }
        }

        /// <summary>
        /// 查询条件列数据类型
        /// </summary>
        public virtual ConditionType Conditiontype
        {
            get { return conditiontype; }
            set { conditiontype = value; }
        }

        /// <summary>
        /// 是否需插入数据列
        /// </summary>
        public virtual bool Isinsertfield
        {
            get { return isinsertfield; }
            set { isinsertfield = value; }
        }

        /// <summary>
        /// 是否需更新数据列
        /// </summary>
        public virtual bool Isupdatefield
        {
            get { return isupdatefield; }
            set { isupdatefield = value; }
        }

        /// <summary>
        /// 是否删除数据条件列
        /// </summary>
        public virtual bool Isdeletefield
        {
            get { return isdeletefield; }
            set { isdeletefield = value; }
        }
    }
}
